package com.qdu.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.qdu.entity.Job;
import com.qdu.entity.Resume;
import com.qdu.mapper.JobMapper;
import com.qdu.service.JobService;

@RestController
@RequestMapping("/job")
public class JobController {

	@Autowired
	JobService service;
	
	@Autowired
	JobMapper m;
	@PostMapping("/getAll")
	public List<Map<String,Object>> getAllList(){
		return service.getAlllist();
	}
	
	@PostMapping("/getOne")
	public Job getOne(String jid){
		return service.getOne(jid);
	}
	/**
	 * ����ְλ����
	 * @param job
	 * @return
	 */
	@PostMapping("/add")
	public String addJob(Job job){
		return service.addJob(job);
	}

	@PostMapping("/getByhr")
	public List<Map<String,Object>> getByhr(@RequestParam("bid") String bid,@RequestParam("batchid") String batchid){
		return m.getByHr(bid,batchid);
	}
	/**
	 * �鿴�����ְλ��Ա���б���������Ϣ
	 * @param jobId
	 * @return
	 */
	@PostMapping("/getListInfoByJobId")
	public List<Resume> getListInfoByJobId(String jobId){
		return service.getListInfoByJobId(jobId);
	}

	/**
	 * ���ÿ��ӦƸ������������
	 * @param process
	 * @return
	 */
	@PostMapping("/review")
	public String reviewJobApply(@RequestBody com.qdu.entity.Process process){
		return service.reviewJobApply(process);
	}
}
